// 包含两种I/O库，可以使用任一种输入输出方式
#include <stdio.h>
#include <iostream>
using namespace std;

int main()
{
    // y-年，m-月,d-日，n-第几天
    int y, m, d, n;
    // 请在此添加代码，计算并输出指定日期是第几天
    /********** Begin *********/
    cin >> y >> m >> d;
    int isLeapYear = 28;
	if (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)) {
        isLeapYear = 29;
    }
    
    
        switch (m) {
            case 1:
                n = d;
                break;
            case 2:
                n = 31 + d;
                break;
            case 3:
                n = 31 + isLeapYear + d;
                break;
            case 4:
                n = 31 * 2 + isLeapYear + d;
                break;
            case 5:
                n = 31 * 2 + 30 + isLeapYear + d;
                break;
            case 6:
                n = 31 * 3 + 30 + isLeapYear + d;
                break;
            case 7:
                n = 31 * 3 + 30 * 2 + isLeapYear + d;
                break;
            case 8:
                n = 31 * 4 + 30 * 2 + isLeapYear + d;
                break;
            case 9:
                n = 31 * 5 + 30 * 2 + isLeapYear + d;
                break;
            case 10:
                n = 31 * 5 + 30 * 3 + isLeapYear + d;
                break;
            case 11:
                n = 31 * 6 + 30 * 3 + isLeapYear + d;
                break;
            case 12:
                n = 31 * 6 + 30 * 4 + isLeapYear + d;
                break;
        
    }
    /********** End **********/
    printf("%d-%d-%d是第%d天\n",y,m,d,n);
    return 0;
}